class_name ObjectPoolManager
extends Resource

@export var pool_manager_name:String
@export var pools:Array[ObjectPool]
var object_parent
var pool_dict:Dictionary = {}

func init_pool_manager(object_parent):
	self.object_parent = object_parent
	for pool in pools:
		pool_dict[pool.pool_name] = pool.duplicate(true)
		var object_pool:ObjectPool = pool_dict[pool.pool_name]
		object_pool.init_pool(self)
		object_pool.fill_pool()
func get_from_pool(pool_name:String):
	if not pool_dict.has(pool_name):
		return null
	var scene = pool_dict[pool_name].get_from_pool()
	return scene
func back_to_pool(pool_name:String,scene):
	if not pool_dict.has(pool_name):
		return null
	pool_dict[pool_name].back_to_pool(scene)
